<template>
  <div class="page page-works-wrapper">
    <div class="banner">
      <img :src="WorksBanner" lazy />
    </div>
    <div class="content">
      <el-row :gutter="20">
        <el-col :xl="6" :lg="8" :md="8" :sm="12" :xs="24" v-for="(item, index) in workList" @click="jumpMovie(item, item.videoLink)" :key="index">
          <el-card :body-style="{ padding: '0px' }">
            <img :src="item.poster" class="img" :alt="item.title" />
            <p>
              <a :title="item.title" rel="nofollow" target="_blank">{{ item.title }}</a>
            </p>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import WorksBanner from '@/assets/images/works/works_banner.jpg'
import workList from './data'

const router = useRouter()

const jumpMovie = (item, link) => {
  if (item.type == 'inner') {
    router.push({
      name: item.routerName
    })
    return
  }
  item.textLink && window.open(item.textLink)
  link && window.open(link)
}
</script>

<style lang="scss" scoped>
.banner {
  width: 100%;
  height: 0;
  padding-bottom: 26.3%;
  background: #ccc;
  img {
    width: 100%;
  }
}
.content {
  margin: 20px auto;
  padding: 0 5%;
  .el-col {
    margin-bottom: 10px;
  }
  .img {
    width: 100%;
    cursor: pointer;
  }
  p {
    padding: 10px;
    a {
      font-size: 16px;
      color: #84a6ef;
      cursor: pointer;
    }
  }
}
</style>
